//剑指 Offer 10- I. 斐波那契数列
//https://leetcode.cn/problems/fei-bo-na-qi-shu-lie-lcof/description/?favorite=xb9nqhhg

int fib(int n)
{
    long  long a=1;
    long  long b=1;
    long  long c=a+b;
    if(n==0)
    {
        return 0;
    }
    else if(n<=2)
    {
        return 1;
    }
    else
    {
        while(n>2)
        {
            c=(a+b)% 1000000007;
            a=b;
            b=c;
            n--;
        }
    }
    return c;

}